Ext.extend(demo.module,{
    init: function(){
    var form = new Ext.FormPanel({
        labelWidth: 150,       
        frame:true,       
        bodyStyle:'padding:50px 50px 0',
        width: 350,
        defaults: {width: 230,inputType:'password'},
        defaultType: 'textfield',
        items: [
            {
                fieldLabel: 'Old password',
                name: 'oldpassword',
                allowBlank:false
            },{
                fieldLabel: 'New password',
                name: 'password1',
                allowBlank:false
            },{
                fieldLabel: 'Confirm',
                name: 'password2',
                allowBlank:false
            }
        ],
        buttons: [{
            text: 'Save',
            handler:function(){
            var form=this.ownerCt;
            if(form.getForm().isValid())
            {
	            form.getForm().submit({url:'changePassword', waitMsg:'save password...',
	            success:function(form, action){
	              Ext.MessageBox.alert('提示信息',action.result.info);       
	            },
	            failure:function(form, action){
	              Ext.MessageBox.alert('错误信息',action.result.info); 
	            }            
	            });
            }
           }
        }]
     });    
	 this.main.add(form);
     this.main.doLayout(); 
    }
});